//
//  RMChatServiceCardCell.m
//  app
//
//  Created by 王宇宙 on 2017/12/28.
//  Copyright © 2017年 Facebook. All rights reserved.
//

#import "RMChatServiceCardCell.h"
#import "UIColor+YZAdd.h"
#import "UIImageview+WebCache.h"

@implementation RMChatServiceCardCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
  
  self.backView.layer.cornerRadius = 5;
  _sendButton.layer.cornerRadius = 5;
  _sendButton.layer.borderWidth = 1;
  _sendButton.layer.borderColor = [UIColor colorWithHexString:@"0xE9692C"].CGColor;
  _sendButton.layer.masksToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setData:(NSDictionary *)data{
  if (!data) {
    return;
  }
  NSString *imgUrl = data[@"headImgUrl"];
  [_itemImageView sd_setImageWithURL:[NSURL URLWithString:imgUrl]];
  _itemNameLabel.text = data[@"title"];
  _serviceNameLabel.text = data[@"tourismStyle"];
  _servicePriceLabel.text = [NSString stringWithFormat:@"%@/%@",data[@"displayPrice"],data[@"displayPriceUnit"]];
}

- (IBAction)sendAction:(UIButton *)sender {
  if (_sendBlock) {
    _sendBlock();
  }
}
@end
